<include file="Public:head" />
</head>
<body>
<div style="margin:0 2%;">
<literal>
<style type="text/css">
  div.section{
    min-height:400px;
  }
  #searchbar{
    text-align:right;
  }
  tr{
    line-height: 1.2em;
  }
  th, td{
    margin:0 2px;
  }
  #console table{
    margin:10px auto;
    width:98%;
    heigth:550px;
  }
</style>
<script type="text/javascript" src="__PUBLIC__/js/master/notice_admin.js"></script>
</literal>
<div class="section">
  <div id="searchbar">
    <form action="{:U('user/search')}" method="GET">
      <input type="text" name="q" value="" id=""/>
      <input type="submit" name="submit" value="搜索"/>
      <input type="hidden" name="role" value="{$role}"/>
    </form>
  </div>
  <form action="{:U('user/')}" method="POST" id="console">
  <table class="content">
    <tr>
      <th style="width:27%;"><input type="checkbox" name="" value="" id="check_all"/>全选</th>
      <th style="width: 5%;">ID</th>
      <th style="width:27%;">用户</th>
      <th style="width:20%;">email</th>
      <th style="width:20%;">学号</th>
    </tr>
   <volist name="accounts" id="vo">
      <tr id="user_{$vo.uid}">
        <td>
          <input type="checkbox" name="id[]" value="{$vo.uid}" id=""/>
          <select name="state[]" id="" onchange="NoticeAdmin.state({$vo.uid}, this.value)">
            <option value="{:UserModel::C('STATE_NORMAL')}" 
              <if condition="UserModel::C('STATE_NORMAL')==$vo['state']">selected="selected"</if>>正常</option>
            <option value="{:UserModel::C('STATE_NEW')}" 
              <if condition="UserModel::C('STATE_NEW')==$vo['state']">selected="selected"</if>>新人</option>
            <option value="{:UserModel::C('STATE_LOCKED')}" 
              <if condition="UserModel::C('STATE_LOCKED')==$vo['state']">selected="selected"</if>>冻结</option>
          </select>
          <select name="role[]" id="" onchange="NoticeAdmin.role({$vo.uid}, this.value)">
            <option value="{:UserModel::C('ROLE_USER_BASIC')}" 
              <if condition="UserModel::C('ROLE_USER_BASIC')==$vo['role']">selected="selected"</if>>个人</option>
            <option value="{:UserModel::C('ROLE_GROUP')}" 
              <if condition="UserModel::C('ROLE_GROUP')==$vo['role']">selected="selected"</if>>社团</option>
          </select>
          <input type="button" value="删除" onclick="NoticeAdmin.del({$vo.uid})"/>
        </td>
        <td>{$vo.uid}</td>
        <td><a href="{:U("Home-user/$vo[uid]")}" target="view">{$vo.name}</a></td>
        <td><a href="{:U("Home-user/$vo[uid]")}" target="view">{$vo.email}</a></td>
        <td><a href="{:U("Home-user/$vo[uid]")}" target="view">{$vo.cardid}</a></td>
      </tr>
    </volist>
  </table>
  <div>
          <select name="" id="" onchange="NoticeAdmin.state(null, this.value)">
            <option value="{:UserModel::C('STATE_NORMAL')}" disabled="disabled">修改状态</option>
            <option value="{:UserModel::C('STATE_NORMAL')}">正常</option>
            <option value="{:UserModel::C('STATE_NEW')}">新人</option>
            <option value="{:UserModel::C('STATE_LOCKED')}">冻结</option>
          </select>
          <select name="role[]" id="" onchange="NoticeAdmin.role(null, this.value)">
            <option value="{:UserModel::C('ROLE_USER_BASIC')}" disabled="disabled">修改组别</option>
            <option value="{:UserModel::C('ROLE_USER_BASIC')}" >个人</option>
            <option value="{:UserModel::C('ROLE_GROUP')}" >社团</option>
          </select>
          <input type="button" value="删除" onclick="NoticeAdmin.del()"/>
  </div>
  </form>
  <div id="page">
    {$page}
  </div>
</div>
<include file="Public:foot" />